# -*- coding: utf-8 -*-
"""
Created on Mon Oct  9 09:27:31 2017

@author: Luther
"""

import os
with open('Blowing in the wind.txt', 'r') as f:
    text = f.read()
text = text.split('\n')
title = "Blowin'in the wind"
singer = 'Bob Dylan'
ps = '1962 by Warner Bros. Inc.'
text.insert(0, title)
text.insert(1, singer)
text.append(ps)
contents = [x + '\n' for x in text[:-1]]
contents.append(text[-1])
with open('Blowing in the wind new.txt', 'w') as f:
    f.writelines(contents)
with open('Blowing in the wind new.txt', 'r') as f:
    text = f.read()
print(text)
